package com.wufan.day08.java2;

public class WrapperTest {

    //调用包装类的构造器
    public static void test1(){
        int num1 = 10;
        Integer in1 = new Integer(num1);
        System.out.println(in1.toString());

        Float f1 = new Float(12.3f);
        System.out.println(f1);

        Boolean b1 = new Boolean("true123");
        System.out.println(b1);
    }

    //基本数据类型：调用包装类的xxxValue()
    //String类型调用
    public static void test2() {
        Integer in1 = new Integer(12);
        int i1 = in1.intValue();
        System.out.println(i1 + 1);
        String string = String.valueOf(in1);
        System.out.println(string);
    }

    public static void main(String[] args) {
        test2();
    }
}
